%% Fig.4(a)
clc; clear; close all;

%% —— 参数设置 —— 
g11    = 1.4;
g12    = -2;
g21    = 1.4;
g22    = 1.6;
k      = 2.6;

x0     = [0.01; 0; 0];   % 初始状态 (x1,x2,x3)
dt     = 0.01;           % 积分步长
t_end  = 1000;            % 终止时间
N      = round(t_end/dt);

%% —— 数值积分 (RK4) —— 
X = zeros(3, N+1);
X(:,1) = x0;
for i = 1:N
    X(:,i+1) = RK4(@(x) MBNHNN(x, k, g11, g12, g21, g22), X(:,i), dt);
end

x1 = X(1, :);
x3 = X(3, :);

%% —— 绘图 —— 
figure;
plot(x3, x1, 'r', 'LineWidth', 1.2);
xlabel('x_3', 'FontSize', 12);
ylabel('x_1', 'FontSize', 12);
title(['(a) \tau_{end} = ', num2str(t_end)], 'FontSize', 14);
grid on;

